import { _decorator } from 'cc'
import { StateMachine } from '../../Base/StateMachine'
import { DIRECTION_ENUM, PARAMS_NAME_ENUM } from '../../Enum'
import State from '../../Base/State'
import { DirectionSubStateMachine } from '../../Base/DirectionSubStateMachine'

const { ccclass, property } = _decorator

/**
 * Predefined variables
 * Name = TurnLeftSubStateMachine
 * DateTime = Sun Jul 10 2022 18:26:27 GMT+0800 (中国标准时间)
 * Author = Zero_Y
 * FileBasename = TurnLeftSubStateMachine.ts
 * FileBasenameNoExtension = TurnLeftSubStateMachine
 * URL = db://assets/Scripts/Player/TurnLeftSubStateMachine.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */
const BASE_URL = 'texture/player/turnleft'

@ccclass('TurnLeftSubStateMachine')
export class TurnLeftSubStateMachine extends DirectionSubStateMachine {
  constructor(fsm: StateMachine) {
    super(fsm)
    // 人物动画，转向
    this.stateMachines.set(DIRECTION_ENUM.TOP, new State(fsm, `${BASE_URL}/top`))
    this.stateMachines.set(DIRECTION_ENUM.BOTTOM, new State(fsm, `${BASE_URL}/bottom`))
    this.stateMachines.set(DIRECTION_ENUM.LEFT, new State(fsm, `${BASE_URL}/left`))
    this.stateMachines.set(DIRECTION_ENUM.RIGHT, new State(fsm, `${BASE_URL}/right`))
  }
}
